package tk.mynoteapp.dev.wechat.pay.common;

import cn.hutool.core.map.CaseInsensitiveMap;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 支付相关请求响应实体
 */
public class PayHttpResponse implements Serializable {
    private String body;
    private int status;
    private Map<String, List<String>> headers;

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Map<String, List<String>> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, List<String>> headers) {
        this.headers = headers;
    }

    public String getHeader(String name) {
        return null;
    }

    private List<String> headerList(String name) {
        if (name == null || name.trim().equals("")) {
            return null;
        } else {
            CaseInsensitiveMap<String, List<String>> headersIgnoreCase = new CaseInsensitiveMap(getHeaders());
            return headersIgnoreCase.get(name.trim());
        }
    }
}
